﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Os.Domain.Cliente>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
   .: Clientes :.
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Lista de Clientes</h2>

    <table>
        <tr>
            <th></th>
            <th>
                Nome
            </th>
            <th>
                Endereço
            </th>
            <th>
                Bairro
            </th>
            <th>
                Cnpj
            </th>
            <th>
                Horas Contratadas
            </th>
             <th>
                Cliente Desde
            </th>
            <th>
                Vigência do Contrato
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Editar", "Editar", new {  id=item.IdCliente  }) %> |
                <%= Html.ActionLink("Detalhes", "Detalhes", new { id = item.IdCliente })%> 
            </td>
            <td>
                <%= Html.Encode(Html.Truncate(item.Nome,10)) %>
            </td>
            <td>
                <%= Html.Encode(Html.Truncate(item.Endereco,10)) %>
            </td>
            <td>
                <%= Html.Encode(Html.Truncate(item.Bairro,10)) %>
            </td>
            <td>
                <%= Html.Encode(item.Cnpj) %>
            </td>
            <td>
                <%= Html.Encode(item.HorasContratadas) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:dd/MM/yyy}", item.Desde))%>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:dd/MM/yyy}", item.VigenciaContrato)) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Novo Cliente", "Novo") %>
    </p>

</asp:Content>

